package org.wdcode.web.constants;

/**
 * HTTP常量
 * @author WD
 * @since JDK6
 * @version 1.0 2009-11-21
 */
public final class HttpConstants {
	/* HTTP提交方式 */
	/**
	 * HTTP提交方式 GET
	 */
	public final static String	METHOD_GET;
	/**
	 * HTTP提交方式 POST
	 */
	public final static String	METHOD_POST;

	/**
	 * 静态初始化
	 */
	static {
		// HTTP提交方式 GET
		METHOD_GET = "GET";
		// HTTP提交方式 POST
		METHOD_POST = "POST";
	}

	/* ContentType */
	/**
	 * ContentType img格式
	 */
	public final static String	CONTENT_TYPE_JPEG;
	/**
	 * ContentType CSV格式
	 */
	public final static String	CONTENT_TYPE_CSV;
	/**
	 * ContentType TXT格式
	 */
	public final static String	CONTENT_TYPE_TXT;
	/**
	 * ContentType VCF格式
	 */
	public final static String	CONTENT_TYPE_VCF;
	/**
	 * ContentType js格式
	 */
	public final static String	CONTENT_TYPE_JS;
	/**
	 * ContentType css格式
	 */
	public final static String	CONTENT_TYPE_CSS;
	/**
	 * ContentType html格式
	 */
	public final static String	CONTENT_TYPE_HTML;
	/**
	 * ContentType gif格式
	 */
	public final static String	CONTENT_TYPE_GIF;
	/**
	 * ContentType png格式
	 */
	public final static String	CONTENT_TYPE_PNG;
	/**
	 * ContentType json格式
	 */
	public final static String	CONTENT_TYPE_JSON;
	/**
	 * ContentType xml格式
	 */
	public final static String	CONTENT_TYPE_XML;

	/**
	 * 静态初始化
	 */
	static {
		// ContentType img格式
		CONTENT_TYPE_JPEG = "image/jpeg";
		// ContentType CSV格式
		CONTENT_TYPE_CSV = "application/vnd.ms-excel";
		// ContentType TXT格式
		CONTENT_TYPE_TXT = "text/plain";
		// ContentType VCF格式
		CONTENT_TYPE_VCF = "text/x-vcard";
		// ContentType js格式
		CONTENT_TYPE_JS = "text/javascript";
		// ContentType css格式
		CONTENT_TYPE_CSS = "text/css";
		// ContentType html格式
		CONTENT_TYPE_HTML = "text/html";
		// ContentType gif格式
		CONTENT_TYPE_GIF = "image/gif";
		// ContentType png格式
		CONTENT_TYPE_PNG = "image/png";
		// ContentType json格式
		CONTENT_TYPE_JSON = "application/json";
		// ContentType xml格式
		CONTENT_TYPE_XML = "text/xml";
	}

	/* HTTP头 */
	/**
	 * Header 获得 IP "X-Forwarded-For"
	 */
	public final static String	HEADER_IP_X_FORWARDED_FOR;
	/**
	 * Header 获得 IP "X-Real-IP"
	 */
	public final static String	HEADER_IP_X_REAL_IP;
	/**
	 * Header 清除缓存 KEY "Pragma"
	 */
	public final static String	HEADER_KEY_PRAGMA;
	/**
	 * Header 清除缓存 KEY "Expires"
	 */
	public final static String	HEADER_KEY_EXPIRES;
	/**
	 * HTTP头 KEY "Cache-Control"
	 */
	public final static String	HEADER_KEY_CACHE_CONTROL;
	/**
	 * HTTP头 KEY "Last-Modified"
	 */
	public final static String	HEADER_KEY_LAST_MODIFIED;
	/**
	 * HTTP头 KEY "If-Modified-Since"
	 */
	public final static String	HEADER_KEY_IF_MODIFIED_SINCE;
	/**
	 * HTTP头 KEY "If-None-Match"
	 */
	public final static String	HEADER_KEY_IF_NONE_MATCH;
	/**
	 * HTTP头 KEY "ETag"
	 */
	public final static String	HEADER_KEY_ETAG;
	/**
	 * HTTP头 KEY "Accept-Encoding"
	 */
	public final static String	HEADER_KEY_ACCEPT_ENCODING;
	/**
	 * HTTP头 VAL "no-cache"
	 */
	public final static String	HEADER_VAL_NO_CACHE;
	/**
	 * HTTP头 VAL "max-age="
	 */
	public final static String	HEADER_VAL_MAX_AGE;

	/**
	 * 静态初始化
	 */
	static {
		// Header 获得 IP "X-Forwarded-For"
		HEADER_IP_X_FORWARDED_FOR = "X-Forwarded-For";
		// Header 获得 IP "X-Real-IP"
		HEADER_IP_X_REAL_IP = "X-Real-IP";
		// 清除缓存 KEY "Pragma"
		HEADER_KEY_PRAGMA = "Pragma";
		// Header 清除缓存 KEY "Expires"
		HEADER_KEY_EXPIRES = "Expires";
		// HTTP头 KEY "Cache-Control"
		HEADER_KEY_CACHE_CONTROL = "Cache-Control";
		// HTTP头 KEY "Last-Modified"
		HEADER_KEY_LAST_MODIFIED = "Last-Modified";
		// HTTP头 KEY "If-Modified-Since"
		HEADER_KEY_IF_MODIFIED_SINCE = "If-Modified-Since";
		// HTTP头 KEY "If-None-Match"
		HEADER_KEY_IF_NONE_MATCH = "If-None-Match";
		// HTTP头 KEY "ETag"
		HEADER_KEY_ETAG = "ETag";
		// HTTP头 KEY "Accept-Encoding"
		HEADER_KEY_ACCEPT_ENCODING = "Accept-Encoding";
		// HTTP头 VAL "no-cache"
		HEADER_VAL_NO_CACHE = "no-cache";
		// HTTP头 VAL "max-age="
		HEADER_VAL_MAX_AGE = "max-age=";
	}

	/**
	 * 私有构造禁止外部实例化
	 */
	private HttpConstants() {}
}
